# _*_ coding : utf-8 _*_
# @Time: 2024/10/14 16:04
# @Author : 石文帅	
# @File : getini
# @Project : python_slfh
import configparser


def get_db_data(one_level, two_level):
    """
    读取ini配置文件
    :param two_level:
    :param one_level:
    :return:
    """
    cfg = configparser.ConfigParser()

    # 我这里使用绝对路径因为我的run.py 和testcase不在一个目录下，执行的时候相对路径会有歧义
    cfg.read('D:/SWS/python_slfh/data.ini', encoding='utf-8')
    #cfg.read('D:../data.ini', encoding='utf-8')

    # cfg.read(r'D:\Users\Administrator\PycharmProjects\interface-pytest\Config\db.ini',encoding='utf-8')
    #
    # data = cfg.items('databases')
    # data = dict(data)
    # data['port'] = int(data['port'])
    return cfg[one_level][two_level]
